GitHub ↗ ← 返回

Running Linux in Microsoft Excel.ass

Enderman/Running Linux in Microsoft Excel.assASS共 215 条字幕
样式信息 (3)
Enderman-CN-C
名称Enderman-CN-C字体更纱黑体 SC字号115主色&H0000EAFF辅色&H000000FF描边色&H00000000背景色&H00000000粗体0斜体0下划线0删除线0水平缩放100垂直缩放100间距0角度0边框样式1描边1.6阴影0.8对齐2左边距0右边距0垂直边距20编码1
Enderman-CN
名称Enderman-CN字体更纱黑体 SC字号115主色&H0000EAFF辅色&H000000FF描边色&H00000000背景色&H46000000粗体0斜体0下划线0删除线0水平缩放100垂直缩放95间距0角度0边框样式3描边0阴影1对齐2左边距0右边距0垂直边距20编码1
Enderman-EN
名称Enderman-EN字体更纱黑体 UI SC字号115主色&H00FFFFFF辅色&H000000FF描边色&H5B000000背景色&H46000000粗体0斜体0下划线0删除线0水平缩放100垂直缩放95间距0角度0边框样式3描边0阴影1对齐2左边距0右边距0垂直边距20编码1
#10:00:00.340:00:07.39Enderman-CN-C
{\fad(200,200)}翻译/压制/字幕制作:HAF半个水果
#20:00:08.310:00:12.31Enderman-CN
{\fad(200,200)\pos(1940.893,388.557)}使用AI工具翻译,如有不准确的地方请在弹幕或评论区指正,谢谢!
#30:00:12.340:00:17.34Enderman-CN
{\fad(200,200)\pos(1940.893,388.557)}翻译质量权威评价:原来25年就有小拉即用机翻糊弄人了
#40:00:07.590:00:13.01Enderman-EN
Hello everybody. So in this video I'll show you how I ran Linux on Microsoft Excel.
#50:00:13.700:00:17.97Enderman-EN
Microsoft Excel is a very powerful suit and you can do lots of things in it.
#60:00:18.250:00:19.71Enderman-EN
Accountants love it.
#70:00:19.980:00:22.16Enderman-EN
Software engineering students despise it
#80:00:22.190:00:25.25Enderman-EN
because universities hate their software engineering students
#90:00:25.480:00:27.30Enderman-EN
and force them to do Excel assignments.
#100:00:27.590:00:28.54Enderman-EN
True story.
#110:00:28.920:00:32.79Enderman-EN
But anyway
#120:00:33.240:00:36.88Enderman-EN
and this project is just an excuse for me to make a funny video.
#130:00:37.490:00:40.26Enderman-EN
Originally
#140:00:40.470:00:44.93Enderman-EN
and he tweeted about it. I got pretty excited
#150:00:44.950:00:47.21Enderman-EN
and he then published the source code.
#160:00:47.750:00:52.33Enderman-EN
Unfortunately
#170:00:52.600:00:54.10Enderman-EN
only printing the output.
#180:00:54.330:00:56.86Enderman-EN
And I thought it'd make a pretty lame video.
#190:00:57.100:01:02.48Enderman-EN
{\fs104}So ultimately
#200:01:03.170:01:06.24Enderman-EN
Took me a couple hours
#210:01:06.800:01:09.65Enderman-EN
I don't want to take long. So
#220:01:09.990:01:11.88Enderman-EN
And then I'll explain how it works.
#230:01:12.590:01:16.86Enderman-EN
All right. So
#240:01:17.220:01:21.45Enderman-EN
It's not an ordinary spreadsheet
#250:01:21.750:01:23.86Enderman-EN
It's a spreadsheet full of macros.
#260:01:24.570:01:29.48Enderman-EN
I can smell your fear. Don't worry
#270:01:29.830:01:31.55Enderman-EN
These times are long over
#280:01:32.170:01:35.13Enderman-EN
Though you should probably keep an eye out just in case.
#290:01:35.670:01:39.02Enderman-EN
So
#300:01:39.040:01:42.20Enderman-EN
this is Linux running in Microsoft Excel.
#310:01:42.550:01:45.76Enderman-EN
Unbelievable. Let me make this a little
#320:01:45.760:01:48.27Enderman-EN
more viewable by scaling the interface up.
#330:01:48.950:01:53.37Enderman-EN
There we go. If the screen overflows
#340:01:53.560:01:59.94Enderman-EN
{\fs81}so this is the reason there isn't all that extra boot information at the beginning we used to have when it wasn't scaled up.
#350:02:00.860:02:04.67Enderman-EN
The rules are simple. There are no rules. It's Linux.
#360:02:05.500:02:09.57Enderman-EN
But jokes aside
#370:02:09.880:02:13.33Enderman-EN
But where do you run the Linux commands? Good question.
#380:02:13.580:02:17.50Enderman-EN
I reserved the C2 cell specifically for the terminal input.
#390:02:17.880:02:19.06Enderman-EN
That's where you run them.
#400:02:19.610:02:22.68Enderman-EN
You can do all the terminal basics in that powershell.
#410:02:23.350:02:25.26Enderman-EN
run the directory listing
#420:02:25.680:02:27.11Enderman-EN
switch the directories
#430:02:27.680:02:28.99Enderman-EN
create files
#440:02:30.000:02:32.45Enderman-EN
even enter and exit Vim.
#450:02:33.610:02:38.10Enderman-EN
The only critical mistake you can make is entering the insert mode in Vim.
#460:02:38.830:02:42.08Enderman-EN
Naturally
#470:02:42.460:02:45.82Enderman-EN
but there is so far no way to input that in the cell.
#480:02:46.300:02:50.59Enderman-EN
I mean
#490:02:50.970:02:52.98Enderman-EN
but I didn't bother to implement that.
#500:02:53.530:02:56.56Enderman-EN
It's a simple switch case statement in the handler function.
#510:02:57.050:02:59.47Enderman-EN
But anyway
#520:02:59.700:03:01.75Enderman-EN
even though I kind of failed to do that
#530:03:02.130:03:05.94Enderman-EN
I think
#540:03:07.550:03:08.88Enderman-EN
So
#550:03:09.430:03:11.30Enderman-EN
There are lots of things you can do
#560:03:11.630:03:15.96Enderman-EN
{\fs104}but from here on out
#570:03:15.990:03:21.40Enderman-EN
essentially converting input from an Excel cell to the Linux std in.
#580:03:21.990:03:23.59Enderman-EN
Not a fan of tedious work.
#590:03:24.220:03:31.17Enderman-EN
{\fs90}Anyway
#600:03:31.630:03:32.72Enderman-EN
Hope dies last.
#610:03:33.800:03:35.44Enderman-EN
Spoiler
#620:03:35.850:03:39.64Enderman-EN
And moreover
#630:03:40.540:03:45.82Enderman-EN
{\fs104}I guess the coolest tedious thing you can implement is the ASI escape sequences support
#640:03:46.060:03:48.18Enderman-EN
so that you could beautify the output.
#650:03:48.860:03:51.46Enderman-EN
But again
#660:03:52.390:03:55.61Enderman-EN
So yeah
#670:03:56.430:03:57.78Enderman-EN
What's the catch?
#680:03:59.130:04:04.40Enderman-EN
{\fs104}Well
#690:04:05.100:04:08.60Enderman-EN
If you do want to implement Linux in pure Excel formulas
#700:04:09.410:04:11.28Enderman-EN
I'm so sorry for you
#710:04:11.610:04:17.78Enderman-EN
{\fs104}But be my guest. In reality
#720:04:17.810:04:24.38Enderman-EN
via the VBA macro. Excel here basically acts as the IO interface.
#730:04:25.010:04:28.55Enderman-EN
The library we're using is mini RV32
#740:04:28.960:04:33.50Enderman-EN
which is the tiniest risk V emulator that fits inside a C header.
#750:04:34.160:04:40.58Enderman-EN
{\fs100}I don't really want to go in depth into the technicalities neither of the VBA macro nor the library.
#760:04:41.220:04:43.31Enderman-EN
I'll try to explain in simple terms.
#770:04:44.690:04:49.24Enderman-EN
Basically
#780:04:49.660:04:52.61Enderman-EN
And each tick there is an event loop that's running.
#790:04:53.140:04:56.54Enderman-EN
Every tick
#800:04:56.870:05:00.82Enderman-EN
you get to send input into the emulator and receive output from it.
#810:05:01.210:05:06.82Enderman-EN
The VBA macro runs 2 to the power of 17 ticks in the emulator at the very beginning
#820:05:06.820:05:08.80Enderman-EN
and every time input is received.
#830:05:09.800:05:13.11Enderman-EN
I just picked that number because I think number 17 is cool.
#840:05:13.740:05:17.89Enderman-EN
And it was somewhat the golden middle between the macro freezing Excel entirely
#850:05:18.410:05:23.48Enderman-EN
{\fs98}and having enough time for theemulator to run an average command and return the output from it.
#860:05:24.200:05:27.10Enderman-EN
So that's how the VBA script works essentially
#870:05:27.770:05:31.08Enderman-EN
the library is a little more tricky to explain in simple terms
#880:05:31.570:05:33.52Enderman-EN
but the event loop is located in it
#890:05:33.970:05:38.04Enderman-EN
and the CSR read and write functions are invoked every tick.
#900:05:38.910:05:43.70Enderman-EN
{\fs104}So we get to process input and send the output with the functions exported from the DLL.
#910:05:44.110:05:47.28Enderman-EN
They're then imported and used accordingly in the VBA script.
#920:05:48.020:05:49.78Enderman-EN
It's just an orchestra really.
#930:05:50.660:05:55.96Enderman-EN
{\fs95}That's one of the more weird and satisfying projects I have worked on since the start of my channel.
#940:05:56.370:06:00.42Enderman-EN
I can't thank NSG650 enough for sharing the initial source code.
#950:06:00.450:06:02.52Enderman-EN
This wouldn't have been possible without him.
#960:06:03.300:06:05.20Enderman-EN
He's a cool guy. Check him out.
#970:06:05.580:06:11.34Enderman-EN
{\fs80}I'm going to leave both the source code and the compiled library along with a micro sheet in the description below
#980:06:11.620:06:13.42Enderman-EN
so you can try it out for yourself.
#990:06:13.780:06:16.91Enderman-EN
Tweet the coolest stuff you can execute in that spreadsheet at me
#1000:06:17.410:06:19.47Enderman-EN
I'm Andderman on Twitter.
#1010:06:20.650:06:23.29Enderman-EN
I'll retweet the craziest stuff you guys execute.
#1020:06:23.890:06:28.21Enderman-EN
{\fs104}I believe collectively you can do much more than me in such a stripped down Linux version.
#1030:06:28.750:06:31.32Enderman-EN
And I'm sorry if my voice is kind of annoying right now.
#1040:06:31.580:06:34.52Enderman-EN
I'm currently sick and my nose is stuffed.
#1050:06:35.100:06:38.05Enderman-EN
I'm trying my best to voice things over right now.
#1060:06:38.760:06:40.79Enderman-EN
Thanks for watching and take care.
#1070:00:07.590:00:13.01Enderman-CN
大家好。在这个视频中,我将向大家展示如何在Microsoft Excel上运行Linux
#1080:00:13.700:00:17.97Enderman-CN
Microsoft Excel是一款功能非常强大的软件,你可以在其中完成许多任务
#1090:00:18.250:00:19.71Enderman-CN
会计师们很喜欢它
#1100:00:19.980:00:22.16Enderman-CN
软件工程专业的学生对它深恶痛绝
#1110:00:22.190:00:25.25Enderman-CN
因为大学讨厌他们的软件工程专业学生
#1120:00:25.480:00:27.30Enderman-CN
还强迫他们做Excel作业
#1130:00:27.590:00:28.54Enderman-CN
真事
#1140:00:28.920:00:32.79Enderman-CN
但不管怎样,爱好者们在Excel里总能玩出各种疯狂的花样
#1150:00:33.240:00:36.88Enderman-CN
而这个项目只是我为了拍个有趣的视频找的借口
#1160:00:37.490:00:40.26Enderman-CN
最初,NSG650制作了这个东西
#1170:00:40.470:00:44.93Enderman-CN
他还在推特上发了相关内容。我对此感到非常兴奋,于是联系了他
#1180:00:44.950:00:47.21Enderman-CN
然后他公布了源代码
#1190:00:47.750:00:52.33Enderman-CN
遗憾的是,经过仔细检查后,我发现他的版本相当简陋
#1200:00:52.600:00:54.10Enderman-CN
只有打印输出
#1210:00:54.330:00:56.86Enderman-CN
我还以为这视频会拍得很无聊
#1220:00:57.100:01:02.48Enderman-CN
最终,我决定插手帮忙,算是替他完成了这个项目,还让它具备了互动性
#1230:01:03.170:01:06.24Enderman-CN
花了我几个小时,但对最终的效果相当满意
#1240:01:06.800:01:09.65Enderman-CN
我不想说太多。直接看实际操作吧
#1250:01:09.990:01:11.88Enderman-CN
然后我会解释它是如何工作的
#1260:01:12.590:01:16.86Enderman-CN
好的。那么,运行它很简单。只需打开Excel电子表格即可
#1270:01:17.220:01:21.45Enderman-CN
这不是一份普通的电子表格,从文件名你大概就能看出来
#1280:01:21.750:01:23.86Enderman-CN
这是一张满是宏的电子表格
#1290:01:24.570:01:29.48Enderman-CN
我能闻到你恐惧的气息。别担心,这里没有宏病毒
#1300:01:29.830:01:31.55Enderman-CN
那样的日子早已一去不复返
#1310:01:32.170:01:35.13Enderman-CN
不过以防万一,你最好还是留意一下
#1320:01:35.670:01:39.02Enderman-CN
好了,你打开文件,哇
#1330:01:39.040:01:42.20Enderman-CN
这是在Microsoft Excel中运行的Linux
#1340:01:42.550:01:45.76Enderman-CN
难以置信。让我把界面
#1350:01:45.760:01:48.27Enderman-CN
放大一点,这样看起来更清楚
#1360:01:48.950:01:53.37Enderman-CN
好了。如果屏幕溢出,它就会重置A列
#1370:01:53.560:01:59.94Enderman-CN
这就是为什么启动时没有看到所有那些额外引导信息了
#1380:02:00.860:02:04.67Enderman-CN
规则很简单。没有规则。这就是Linux
#1390:02:05.500:02:09.57Enderman-CN
玩笑归玩笑,整个A列是专门留给终端输出的
#1400:02:09.880:02:13.33Enderman-CN
但在哪里运行这些Linux命令呢?问得好
#1410:02:13.580:02:17.50Enderman-CN
我特意为终端输入保留了C2单元格
#1420:02:17.880:02:19.06Enderman-CN
那就是你运行它们的地方
#1430:02:19.610:02:22.68Enderman-CN
你可以在那个PowerShell中完成所有终端基础操作
#1440:02:23.350:02:25.26Enderman-CN
列举目录
#1450:02:25.680:02:27.11Enderman-CN
切换目录
#1460:02:27.680:02:28.99Enderman-CN
创建文件
#1470:02:30.000:02:32.45Enderman-CN
甚至可以进入和退出 Vim
#1480:02:33.610:02:38.10Enderman-CN
在Vim中,唯一可能犯的致命错误就是进入插入模式
#1490:02:38.830:02:42.08Enderman-CN
当然,你需要按Esc键才能返回
#1500:02:42.460:02:45.82Enderman-CN
但目前还没有办法在单元格中输入这个
#1510:02:46.300:02:50.59Enderman-CN
我是说,从技术上讲,你可以创建映射到特殊键的魔法序列
#1520:02:50.970:02:52.98Enderman-CN
但我懒得去实现
#1530:02:53.530:02:56.56Enderman-CN
这是处理函数中的一个简单switch case语句
#1540:02:57.050:02:59.47Enderman-CN
但不管怎样,你甚至可以运行脚本
#1550:02:59.700:03:01.75Enderman-CN
尽管我在这方面有些失败了
#1560:03:02.130:03:05.94Enderman-CN
我想,是因为我无法在单元格后面换行
#1570:03:07.550:03:08.88Enderman-CN
所以,它还相当简陋
#1580:03:09.430:03:11.30Enderman-CN
有许多事情你可以做
#1590:03:11.630:03:15.96Enderman-CN
但从现在开始,就只剩下实现各种魔法序列的繁琐工作了
#1600:03:15.990:03:21.40Enderman-CN
本质上将Excel单元格的输入转换为Linux的标准输入
#1610:03:21.990:03:23.59Enderman-CN
不喜欢繁琐的工作
#1620:03:24.220:03:31.17Enderman-CN
不管怎样,就说我试图运行devil fetch吧,尽管这是个bash脚本而这里根本没有bash环境
#1630:03:31.630:03:32.72Enderman-CN
希望最后才会破灭
#1640:03:33.800:03:35.44Enderman-CN
剧透一下,这没有用
#1650:03:35.850:03:39.64Enderman-CN
而且,我试了几次,它还导致宏崩溃了几次
#1660:03:40.540:03:45.82Enderman-CN
我猜你能实现的最酷又繁琐的功能就是支持ASI转义序列
#1670:03:46.060:03:48.18Enderman-CN
这样你就可以美化输出结果
#1680:03:48.860:03:51.46Enderman-CN
但话说回来,实现起来还是挺烦人的
#1690:03:52.390:03:55.61Enderman-CN
没错,这就是在Microsoft Excel里运行的Linux
#1700:03:56.430:03:57.78Enderman-CN
有什么猫腻?
#1710:03:59.130:04:04.40Enderman-CN
嗯,你可以认为这是作弊,因为它并不是在原生Excel公式中运行的Linux
#1720:04:05.100:04:08.60Enderman-CN
如果你确实想在纯Excel公式中实现Linux
#1730:04:09.410:04:11.28Enderman-CN
我很抱歉无法实现,我的朋友
#1740:04:11.610:04:17.78Enderman-CN
但请随意。实际上,Linux运行在一个独立的库中
#1750:04:17.810:04:24.38Enderman-CN
该库通过VBA宏加载到Excel中。这里的Excel基本上充当了输入输出接口的角色
#1760:04:25.010:04:28.55Enderman-CN
我们使用的库是mini RV32
#1770:04:28.960:04:33.50Enderman-CN
这是能塞进C语言头文件的最小RISC-V模拟器
#1780:04:34.160:04:40.58Enderman-CN
我既不想深入探讨VBA宏的技术细节,也不想讨论这个库的技术问题
#1790:04:41.220:04:43.31Enderman-CN
我会尽量用简单的语言来解释
#1800:04:44.690:04:49.24Enderman-CN
基本上,模拟器允许你通过一个函数逐步执行每个时钟周期
#1810:04:49.660:04:52.61Enderman-CN
每个时钟周期都有一个正在运行的事件循环
#1820:04:53.140:04:56.54Enderman-CN
每一个时刻,本质上是你选择的一个时间点
#1830:04:56.870:05:00.82Enderman-CN
你可以向模拟器发送输入并接收其输出
#1840:05:01.210:05:06.82Enderman-CN
VBA宏在模拟器中最初运行时以及每次接收到输入时,会运行2的17次方个时钟周期
#1850:05:06.820:05:08.80Enderman-CN
VBA宏在模拟器中最初运行时以及每次接收到输入时,会运行2的17次方个时钟周期
#1860:05:09.800:05:13.11Enderman-CN
我选那个数字只是因为我觉得17很酷
#1870:05:13.740:05:17.89Enderman-CN
这大致是在宏完全冻结Excel与给予模拟器足够时间
#1880:05:18.410:05:23.48Enderman-CN
运行平均命令并返回输出之间的一个理想折中点
#1890:05:24.200:05:27.10Enderman-CN
这就是VBA脚本的基本工作原理
#1900:05:27.770:05:31.08Enderman-CN
用简单的语言来解释这个库有点复杂
#1910:05:31.570:05:33.52Enderman-CN
但事件循环位于其中
#1920:05:33.970:05:38.04Enderman-CN
每个时钟周期都会调用CSR的读写函数
#1930:05:38.910:05:43.70Enderman-CN
因此我们可以处理输入并通过从DLL导出的函数发送输出
#1940:05:44.110:05:47.28Enderman-CN
随后它们被导入并在VBA脚本中相应使用
#1950:05:48.020:05:49.78Enderman-CN
这不过是个协调分工的过程
#1960:05:50.660:05:55.96Enderman-CN
这是我频道创立以来做过的最古怪又最令人满足的项目之一
#1970:05:56.370:06:00.42Enderman-CN
我无法充分感谢NSG650分享最初的源代码
#1980:06:00.450:06:02.52Enderman-CN
但没有他,这一切都不可能实现
#1990:06:03.300:06:05.20Enderman-CN
他是个很酷的家伙。去关注他吧
#2000:06:05.580:06:11.34Enderman-CN
我将在下面的描述中同时提供源代码、编译好的库以及一份简要说明
#2010:06:11.620:06:13.42Enderman-CN
这样你就可以亲自尝试一下
#2020:06:13.780:06:16.91Enderman-CN
把你能在那个电子表格里执行的最酷的东西发推给我
#2030:06:17.410:06:19.47Enderman-CN
我推特是endermanch
#2040:06:20.650:06:23.29Enderman-CN
我会转发你们执行的那些最疯狂的事情
#2050:06:23.890:06:28.21Enderman-CN
我相信在这个精简版的Linux系统中,你们集体能做的远比我一个人多
#2060:06:28.750:06:31.32Enderman-CN
如果我现在的声音有点烦人,我很抱歉
#2070:06:31.580:06:34.52Enderman-CN
我现在生病了,有点鼻塞
#2080:06:35.100:06:38.05Enderman-CN
我正在尽力为当前的内容配音
#2090:06:38.760:06:40.79Enderman-CN
感谢观看,保重
#2100:06:32.780:06:36.78Enderman-CN
{\fad(200,200)\pos(1976.893,326.557)}原标题:Running Linux in Microsoft Excel 原作者:Enderman
#2110:06:36.940:06:40.94Enderman-CN
{\fad(200,200)\pos(1976.893,326.557)}原视频上传日期:2025年4月30日
#2120:06:41.790:06:58.73Enderman-CN-C
{\fad(0,200)\fscx233\fscy244\pos(1954.49,808.69)}在 Youtube 上关注
#2130:06:42.180:06:46.18Enderman-CN-C
{\fad(200,200)\pos(1948,1176)}翻译/压制/字幕制作:HAF半个水果
#2140:06:46.560:06:51.56Enderman-CN-C
{\fad(200,200)\pos(1916,1320)}翻译质量权威评价:原来25年就有小拉即用机翻糊弄人了\N
\N
向所有字幕制作及相关人员道一声辛苦了 (*ˊᗜˋ*)/ᵗᑋᵃᐢᵏ ᵞᵒᵘ*\N
感谢字幕组的默默耕耘,你们的每一行字都能让更多人能够跨越语言障碍,享受精彩的内容
#2150:06:51.780:06:55.78Enderman-CN-C
{\fad(200,200)\pos(1959.333,1182)}字幕制作不易,喜欢的话支持一下我吧!